import {SAVE_REAGENTS_TYPE, SAVE_EXPERIMENT_INFO} from "./constants";

const defaultState = {
  reagentsType: 0,
  isClicked: false,
  experimentInfo: {
    barcode: "",
    comments: "",
    experimentIdentify: "Quantitation/Standard Curve",
    reagentsType: "Probe",
    runMode: "Standard/Sample Temperature"
  }
};

export default function reducer(state = defaultState, action) {
  switch (action.type) {
    case SAVE_REAGENTS_TYPE :
      return {...state, reagentsType: action.reagentsType, isClicked: action.isClicked};
    case SAVE_EXPERIMENT_INFO :
      return {...state, experimentInfo: action.experimentInfo};
    default:
      return state;
  }
}